
loop_move.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <loop_move>:
#include <string.h>

#define MAX_LEN 20

void loop_move(char *pstr, int steps)
{
   0:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
   4:	910003fd 	mov	x29, sp
   8:	f9000fa0 	str	x0, [x29, #24]
   c:	b90017a1 	str	w1, [x29, #20]
	int n = strlen(pstr) - steps;
  10:	f9400fa0 	ldr	x0, [x29, #24]
  14:	94000000 	bl	0 <strlen>
  18:	2a0003e1 	mov	w1, w0
  1c:	b94017a0 	ldr	w0, [x29, #20]
  20:	4b000020 	sub	w0, w1, w0
  24:	b9003fa0 	str	w0, [x29, #60]
	char tmp[MAX_LEN];
	
	strcpy(tmp, pstr + n);	
  28:	b9803fa0 	ldrsw	x0, [x29, #60]
  2c:	f9400fa1 	ldr	x1, [x29, #24]
  30:	8b000021 	add	x1, x1, x0
  34:	9100a3a0 	add	x0, x29, #0x28
  38:	94000000 	bl	0 <strcpy>
	strcpy(tmp + steps, pstr);	
  3c:	b98017a0 	ldrsw	x0, [x29, #20]
  40:	9100a3a1 	add	x1, x29, #0x28
  44:	8b000020 	add	x0, x1, x0
  48:	f9400fa1 	ldr	x1, [x29, #24]
  4c:	94000000 	bl	0 <strcpy>
	*(tmp + strlen(pstr)) = '\0';
  50:	f9400fa0 	ldr	x0, [x29, #24]
  54:	94000000 	bl	0 <strlen>
  58:	aa0003e1 	mov	x1, x0
  5c:	9100a3a0 	add	x0, x29, #0x28
  60:	8b010000 	add	x0, x0, x1
  64:	3900001f 	strb	wzr, [x0]
	strcpy(pstr, tmp);
  68:	9100a3a0 	add	x0, x29, #0x28
  6c:	aa0003e1 	mov	x1, x0
  70:	f9400fa0 	ldr	x0, [x29, #24]
  74:	94000000 	bl	0 <strcpy>
}
  78:	d503201f 	nop
  7c:	a8c47bfd 	ldp	x29, x30, [sp], #64
  80:	d65f03c0 	ret

0000000000000084 <loop_m>:

void loop_m(char *pstr, int steps)
{
  84:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  88:	910003fd 	mov	x29, sp
  8c:	f9000fa0 	str	x0, [x29, #24]
  90:	b90017a1 	str	w1, [x29, #20]
	int n = strlen(pstr) - steps;
  94:	f9400fa0 	ldr	x0, [x29, #24]
  98:	94000000 	bl	0 <strlen>
  9c:	2a0003e1 	mov	w1, w0
  a0:	b94017a0 	ldr	w0, [x29, #20]
  a4:	4b000020 	sub	w0, w1, w0
  a8:	b9003fa0 	str	w0, [x29, #60]
	char tmp[MAX_LEN];
	
	memcpy(tmp, pstr + n, steps);
  ac:	b9803fa0 	ldrsw	x0, [x29, #60]
  b0:	f9400fa1 	ldr	x1, [x29, #24]
  b4:	8b000021 	add	x1, x1, x0
  b8:	b98017a2 	ldrsw	x2, [x29, #20]
  bc:	9100a3a0 	add	x0, x29, #0x28
  c0:	94000000 	bl	0 <memcpy>
	
	memcpy(pstr + steps, pstr, n);
  c4:	b98017a0 	ldrsw	x0, [x29, #20]
  c8:	f9400fa1 	ldr	x1, [x29, #24]
  cc:	8b000020 	add	x0, x1, x0
  d0:	b9803fa1 	ldrsw	x1, [x29, #60]
  d4:	aa0103e2 	mov	x2, x1
  d8:	f9400fa1 	ldr	x1, [x29, #24]
  dc:	94000000 	bl	0 <memcpy>
	printf("t %s\n", pstr);
  e0:	90000000 	adrp	x0, 0 <loop_move>
  e4:	91000000 	add	x0, x0, #0x0
  e8:	f9400fa1 	ldr	x1, [x29, #24]
  ec:	94000000 	bl	0 <printf>
	
	memcpy(pstr, tmp, steps);
  f0:	b98017a1 	ldrsw	x1, [x29, #20]
  f4:	9100a3a0 	add	x0, x29, #0x28
  f8:	aa0103e2 	mov	x2, x1
  fc:	aa0003e1 	mov	x1, x0
 100:	f9400fa0 	ldr	x0, [x29, #24]
 104:	94000000 	bl	0 <memcpy>
	printf("t %s\n", pstr);
 108:	90000000 	adrp	x0, 0 <loop_move>
 10c:	91000000 	add	x0, x0, #0x0
 110:	f9400fa1 	ldr	x1, [x29, #24]
 114:	94000000 	bl	0 <printf>
}
 118:	d503201f 	nop
 11c:	a8c47bfd 	ldp	x29, x30, [sp], #64
 120:	d65f03c0 	ret

0000000000000124 <main>:

int main()
{
 124:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
 128:	910003fd 	mov	x29, sp
	char str[10] = "xiaozhi";
 12c:	90000000 	adrp	x0, 0 <loop_move>
 130:	91000000 	add	x0, x0, #0x0
 134:	f9400000 	ldr	x0, [x0]
 138:	f9000fa0 	str	x0, [x29, #24]
 13c:	790043bf 	strh	wzr, [x29, #32]
	char *p = str;
 140:	910063a0 	add	x0, x29, #0x18
 144:	f90017a0 	str	x0, [x29, #40]
	
	loop_move(str, 2);	
 148:	910063a0 	add	x0, x29, #0x18
 14c:	52800041 	mov	w1, #0x2                   	// #2
 150:	94000000 	bl	0 <loop_move>
	//loop_m(str, 2);
	printf("%s\n", p);
 154:	f94017a0 	ldr	x0, [x29, #40]
 158:	94000000 	bl	0 <puts>
 15c:	52800000 	mov	w0, #0x0                   	// #0
}
 160:	a8c37bfd 	ldp	x29, x30, [sp], #48
 164:	d65f03c0 	ret
